<template>
  <div>
<h1>投资列表</h1>
投资名称:<input type="text" v-model="state.TName">
投资总金额:<input type="text" v-model="state.Min">-<input type="text" v-model="state.Max">
<input type="button" value="查询" @click="show">
<table>
  <tr>
    <td>投资id</td>
    <td>投资名称</td>
    <td>投资总金额</td>
    <td>已投金额</td>
    <td>剩余金额</td>
    <td>投资人数</td>
    <td>操作</td>
  </tr>
  <tr v-for="item in list">
    <td>{{item.Tid}}</td>
    <td>{{item.TName}}</td>
    <td>{{item.ZongE}}</td>
    <td>{{item.YiTou}}</td>
    <td>{{item.ShengYu}}</td>
    <td>{{item.Number}}</td>
    <td>
      <input type="button" value="查看明细" @click="tiao">
    </td>
  </tr>
</table>
  </div>
</template>

<script setup lang="ts">
import {reactive,toRefs,onMounted} from 'vue'
import axios from 'axios'
import {useRoute,useRouter} from 'vue-router'
const router=useRouter()
const route=useRoute()

let data:any=reactive({
  state:{
    TName:'',
    Max:'',
    Min:''
  },
  list:[]
})

let {state,list}=toRefs(data)

onMounted(()=>{
  show()
})

const tiao=()=>{
  router.push('/mingxi');
}

const show=()=>{
axios({
  url:'api/XinXi/GetShowTouZi',
  method:'get',
  params:state.value
})
.then(res=>{
  console.log(res.data);
  list.value=res.data.data;
  console.log(res.data.data.length);
})
.catch(err=>{
  console.log(err);
  
})
}
</script>

<style scoped>

</style>